Skip to content

+ expose Nintendo Yaz0 and Yay0 LZ building blocks - #111

Merged
Hawkynt merged 1 commit into
mainfrom
feat/nintendo-lz-building-blocks
Aug 28, 2026
Merged

+ expose Nintendo Yaz0 and Yay0 LZ building blocks#111
Hawkynt merged 1 commit into
mainfrom
feat/nintendo-lz-building-blocks

Conversation

@Hawkynt

@Hawkynt Hawkynt commented Aug 28, 2026

Copy link
Copy Markdown
Owner

What changed

  • add raw Yaz0BuildingBlock and Yay0BuildingBlock primitives to the benchmarkable catalogue
  • share one clean-room 4 KiB Nintendo LZ match finder/tokenizer instead of duplicating search logic
  • implement Yaz0 grouped 8-bit control streams with the standard 16-byte header
  • implement Yay0 split mask/link/chunk tables with big-endian offsets and long-match length bytes
  • validate headers, table boundaries, output bounds, and backward-reference distances during decode

Verification

Added NUnit coverage for:

  • empty input for both codecs
  • deterministic literal-only Yaz0 and Yay0 wire vectors
  • highly repetitive data and compression ratio
  • repeated English phrase and compression ratio
  • random incompressible data
  • all 256 byte values
  • malformed Yaz0 back-reference rejection
  • malformed Yay0 table-offset rejection
  • stable building-block metadata

The implementations are clean-room from the published Nintendo format descriptions; repository CI performs compile/test verification in this environment. Because these are new public building-block types, the new package README drift gate may produce a regenerated Core README artifact which will be committed verbatim if required.

@Hawkynt
Hawkynt force-pushed the feat/nintendo-lz-building-blocks branch from a2d4a7c to 51e7cc0 Compare August 28, 2026 16:12
One clean-room 4 KiB match finder feeds both: Yaz0 writes grouped eight-bit
control streams behind the usual sixteen-byte header, Yay0 splits mask, link
and chunk tables with big-endian offsets and a length byte for long matches.
Headers, table bounds, output bounds and reference distances are all checked
on the way back in.

The Yay0 writer allocated its two-byte link buffer inside the token loop,
which the release build refuses as a stack-overflow risk.
@Hawkynt
Hawkynt force-pushed the feat/nintendo-lz-building-blocks branch from 51e7cc0 to a89fd7f Compare August 28, 2026 16:28
@Hawkynt
Hawkynt merged commit bbe8db1 into main Aug 28, 2026
3 checks passed
@Hawkynt
Hawkynt deleted the feat/nintendo-lz-building-blocks branch August 28, 2026 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant